package com.songshuang.myutilsboot.common.util;

import java.net.URLDecoder;
import java.net.URLEncoder;
import java.nio.charset.StandardCharsets;

public class URLUtil {
    public static String encode(String url) {
        return URLEncoder.encode(url, StandardCharsets.UTF_8);
    }
    public static String decode(String url){
        return URLDecoder.decode(url, StandardCharsets.UTF_8);
    }

    public static void main(String[] args) {
        String url = "D:\\workspace\\javaworkspace\\myutilsboot\\images\\tmp_20250402_173603\\page_1.png";
        System.out.println(encode(url));
//        System.out.println(decode(encode(url)));
    }
}
